home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
tex-k
/
tex-k-archive.past
/
tex-k-archive.gz
/
tex-k-archive
/
000432_janl@math.uio.no_Sat Mar 26 00:24:37 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-10-11
|
2KB
Received: from pat.uio.no by cs.umb.edu with SMTP id AA16791
(5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Sat, 26 Mar 1994 02:12:05 -0500
Received: from ulrik.uio.no by pat.uio.no with local-SMTP (PP)
id <27443-0@pat.uio.no>; Fri, 25 Mar 1994 23:24:39 +0100
Received: from mnemosyne.uio.no by smaug.uio.no ;
Fri, 25 Mar 1994 23:24:38 +0100
Message-Id: <9403252224.AAsmaug27575@smaug.uio.no>
To: tex-k@cs.umb.edu
Reply-To: janl@math.uio.no
Subject: a script to generate ls-R files
Date: Fri, 25 Mar 1994 23:24:37 +0100
From: Nicolai Langfeldt <janl@math.uio.no>
As some people might have notived I'm using the external database
exclusivly to cut down startup time. The reasons are a bit messy and
you don't wanna know :-) Anyway, I wrote this perl script to generate
ls-R files I'm much more happy with. All the network mounted fonts are
in directory names starting with zz, forcing those to be scanned last
and causing fonts in them that in local directories not to be listed
in the database . It is of course much slower than 'ls -R' but builds
a eminently desierable database :-)
So, here for you to enjoy any way you wish, no strings atached:
#!/local/bin/perl -w
#
# Simple script to generate a ls -R like file listing with no duplicates.
# Will always prefer the first one in the path. Subdirs to the topdirs
# are traversed in alphabetical order.
#
# - janl@math.uio.no
$topdirs = '/local/TEX/lib'; # Space separated list
%alreadyfound = ();
open(OUT,">ls-R");
foreach $t (split(' ',$topdirs)) {
&recursedir($t);
}
close(OUT);
exit(0);
sub recursedir {
local($currentdir) = @_;
local(@subdirs,$d);
@subdirs=();
# We don't have more than one DIR open at a time so that's not local
# and if we die on this it's because of a internal error, or maybe
# someone doing work on the directories we're traversing.
opendir(DIR,$currentdir) || die;
print OUT "$currentdir:\n";
foreach $f (readdir(DIR)) {
next if (($f eq '.') || ($f eq '..') || ($f =~ /~/));
$fn="$currentdir/$f";
stat($fn);
if (-d _) {
push(@subdirs,$fn);
} elsif ((-f _) && (!$alreadyfound{$f})) {
$alreadyfound{$f}=1;
print OUT "$f\n";
}
}
closedir(DIR);
print OUT "\n";
foreach $d (sort(@subdirs)) {
&recursedir($d);
}
}
--
Nicolai Langfeldt, janl@math.uio.no
Linux miscellanea, TeX stuff